package com.example;

//import net.unicon.cas.client.configuration.EnableCasClient;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
import com.example.annotation.CustomAsync;
import com.example.model.Stu;
import org.apache.ibatis.session.SqlSessionFactory;
import org.example.service.DemoService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import javax.sql.DataSource;

@EnableCaching
//@EnableAsync(annotation = CustomAsync.class)
@EnableAsync
@SpringBootApplication(exclude = {TaskExecutionAutoConfiguration.class, TaskSchedulingAutoConfiguration.class})
//@SpringBootApplication
@ImportResource("classpath:spring-context.xml")
@MapperScan(basePackages={"com.example.mapper"})
@EnableWebMvc
@EnableAspectJAutoProxy
@EnableTransactionManagement
public class DemoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(DemoApplication.class, args);
//        System.out.println(Thread.currentThread()+" "+context.getBean(DemoService.class));
    }

}
